package com.ruoyi.books.service.impl;

import java.util.List;

import com.ruoyi.books.domain.BookManage;
import com.ruoyi.books.mapper.BookManageMapper;
import com.ruoyi.books.service.IBookManageService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 图书信息Service业务层处理
 *
 * @author wt
 * @date 2025-03-15
 */
@Service
public class BookManageServiceImpl implements IBookManageService
{
    @Autowired
    private BookManageMapper bookManageMapper;

    /**
     * 查询图书信息
     *
     * @param id 图书信息主键
     * @return 图书信息
     */
    @Override
    public BookManage selectBookManageById(String id)
    {
        return bookManageMapper.selectBookManageById(id);
    }

    /**
     * 查询图书信息列表
     *
     * @param bookManage 图书信息
     * @return 图书信息
     */
    @Override
    public List<BookManage> selectBookManageList(BookManage bookManage)
    {
        return bookManageMapper.selectBookManageList(bookManage);
    }

    /**
     * 新增图书信息
     *
     * @param bookManage 图书信息
     * @return 结果
     */
    @Override
    public int insertBookManage(BookManage bookManage)
    {
        bookManage.setCreateTime(DateUtils.getNowDate());
        return bookManageMapper.insertBookManage(bookManage);
    }

    /**
     * 修改图书信息
     *
     * @param bookManage 图书信息
     * @return 结果
     */
    @Override
    public int updateBookManage(BookManage bookManage)
    {
        bookManage.setUpdateTime(DateUtils.getNowDate());
        return bookManageMapper.updateBookManage(bookManage);
    }

    /**
     * 批量删除图书信息
     *
     * @param ids 需要删除的图书信息主键
     * @return 结果
     */
    @Override
    public int deleteBookManageByIds(String[] ids)
    {
        return bookManageMapper.deleteBookManageByIds(ids);
    }

    /**
     * 删除图书信息信息
     *
     * @param id 图书信息主键
     * @return 结果
     */
    @Override
    public int deleteBookManageById(String id)
    {
        return bookManageMapper.deleteBookManageById(id);
    }
}
